<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>登录</title>
<link rel="icon" href="">
<style type="text/css">
body {
	padding-top: 50px;
}

.starter-template {
	padding: 40px 15px;
	text-align: center;
}
</style>

</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand" href="#">Spring Security演示</a>
			</div>
			<div id="navbar" class="collapse navbar-collapse">
				<ul class="nav navbar-nav">
					<li><a th:href="@{/}">首页</a></li>
					<li><a th:href="@{http://www.baidu.com}">百度</a></li>
				</ul>
			</div>
		</div>
	</nav>
	<div class="container">
		<div class="starter-template">
			<p th:if="${param.logout}" class="bg-warning">已注销</p>
			<p th:if="${param.error}" class="bg-danger">有错误，请重试</p>
			<h2>使用账号密码登录</h2>
			<form th:action="@{/login1}" method="post">
				<div class="form-group">
					<label for="username">账号</label> <input type="text" name="username"
						value="sjy" placeholder="账号" />
				</div>
				<div class="form-group">
					<label for="password">密码</label> <input type="password"
						name="password" placeholder="密码" />
				</div>
				<div class="form-group">
					<input type="text" class="form-control pull-left margin-r-5"
						name="kaptcha" autocomplete="off"
						style="width: 6%; margin-left: 6%; display: inline ;height:30px"
						placeholder="验证码"> <img th:src="@{/getKaptchaImage}"
						width="140" height="34"
						class="captcha changeCaptcha pull-left margin-r-5" alt="验证码" /> <a
						href="javascript:void(0)" class="changeCaptcha">换一张</a>
					<div class="clear"></div>
				</div>
				<input type="submit" value="登陆" /> 
				<a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=101558978&redirect_uri=http://ly.sjyweixin.cn//login/qq&state=test" class="btn btn-primary btn-block">QQ登录</a>
			</form>
			<form th:action="@{/custom-logout}" method="post">
				<input type="submit" value="退出">
			</form>
		</div>
	</div>
	<script src="/js/jquery.min.js"></script>
	<script type="text/javascript">
		//切换验证码
		 $(document).on('click', '.changeCaptcha', function() {
			var url = "/getKaptchaImage";
			$(".captcha").attr("src", url);
		}) 
	</script>
</body>
</html>
